#version 330 core
// vim: set filetype=cpp :vim

uniform mat4 mView;

uniform ivec3 p0int;
uniform float s;
uniform float w;
uniform float rad;
layout(location=0) in vec3 pos;
out vec2 texcoord;

void main(void) {
	texcoord = (pos.xy+1.0)/2.0;
	float x = (-1-pos.x)/2*w/2;
	float y =-(-1-pos.y)/2*w/2;
	if(rad>1){
		y=y/rad;
		x=x/rad;
		float diff = (w-w/rad)/2;
		x=x-diff;
	}else{
		float diff = -(w-w/rad)/2;
		y=y+diff;
	}

	if (x>0)
		x=0;
	vec4 postemp=mView*vec4(x*0.95,y*0.95,1,1);
	gl_Position=vec4(postemp.xy,0,1);
} 

